def print_christmas_tree(height):
    # 打印树的顶部部分
    for i in range(height):
        # 打印前面的空格
        for j in range(height - i - 1):
            print(" ", end="")
        # 打印星号
        for k in range(2 * i + 1):
            print("*", end="")
        # 换行
        print()
    
    # 打印树干
    trunk_width = height // 3  # 树干的宽度是树高的三分之一
    trunk_height = height // 4  # 树干的高度是树高的四分之一
    
    # 确定树干开始的位置
    trunk_start = (height - trunk_height) // 2
    
    for i in range(trunk_start, trunk_start + trunk_height):
        for j in range(height - trunk_width - 1):
            print(" ", end="")
        for k in range(trunk_width):
            print("|", end="")
        print()

# 设定圣诞树的高度
tree_height = 10
print_christmas_tree(tree_height)